#include "RTPDecoderWrapper.hpp"
#include "RtpPacket.hpp"
#include "RTPDecoderHandle.hpp"

#include "RtpDecoder.hpp"

namespace Hi {
	
RTPDecoderWrapper::RTPDecoderWrapper() {
	impl = new RtpDecoder();
}

RTPDecoderWrapper::~RTPDecoderWrapper() {
	if (nullptr == impl) {
		return;
	}
	delete impl;
	impl = nullptr;
}

void RTPDecoderWrapper::Start(RTPDecoderHandle& handle, uint32_t width, uint32_t height, void* option) {
	if (impl != nullptr) {
		impl->Start(handle, width, height, option);	
	}
}

void RTPDecoderWrapper::Decode(RtpPacket* packet) {
	if (impl != nullptr) {
		impl->OnRtpPacket(packet);
	}
}

void RTPDecoderWrapper::Stop() {
	if (impl != nullptr) {
		impl->Stop();
	}
}
}